home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20031118-20041115 / 000398_fdc@columbia.edu_Tue Sep 21 17:51:07 2004.msg < prev    next >
Internet Message Format  |  2020-01-01  |  2KB

  1. Path: newsmaster.cc.columbia.edu!not-for-mail
  2. From: Frank da Cruz <fdc@columbia.edu>
  3. Newsgroups: comp.protocols.kermit.misc
  4. Subject: Re: Return codes and If statments
  5. Date: 21 Sep 2004 21:51:01 GMT
  6. Organization: Columbia University
  7. Lines: 50
  8. Message-ID: <slrncl18i5.56s.fdc@sesame.cc.columbia.edu>
  9. References: <3f9c05b0.0409211252.5aa51cb1@posting.google.com>
  10. Reply-To: fdc@columbia.edu
  11. NNTP-Posting-Host: sesame.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 1095803461 4227 128.59.59.56 (21 Sep 2004 21:51:01 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 21 Sep 2004 21:51:01 GMT
  15. User-Agent: slrn/0.9.8.0 (SunOS)
  16. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:15175
  17.  
  18. On 2004-09-21, Peter V. <dm_v_2000@yahoo.com> wrote:
  19. : I am modifying a C-Kermit script I have to not continue processing
  20. : if a call to another script does not return a value of 1 (We are doing
  21. : this for fail over testing).
  22. :
  23. : Here is the C-Kermit code in question:
  24. :
  25. : # run the db_status script in the CRON directory
  26. : run db_status
  27. :
  28. : # See if the ret value is != 1
  29. : #  If it != 1 tell user we are not on the primay server and then
  30. : exit).
  31. :
  32. : if != \v(pexitstat) 1 
  33. :  { 
  34. :    echo Return code != 1 ... Not the primary server
  35. :    echo return code =  \v(pexitstat)
  36. :    exit
  37. :  
  38. :   }
  39. : # otherwise we are on the primary server so continue processing
  40. : ...
  41. : ...
  42. : ...
  43. :
  44. : When I run this on the Secondary server it works (since the result
  45. : returned from the db_status script is a 2 since it is not the primary
  46. : server).
  47. :
  48. : However, when I test this on the primay server the code exits (meaning
  49. : it executes the body of the if statment above) despite the fact that
  50. : the return code from db_status is 1.
  51. :
  52. : Any suggestions, as to what I'm doing wrong?
  53. :
  54. My first suggestion is to use the recommended format for grouping statements:
  55.  
  56.   if != \v(pexitstat) 1 { 
  57.       echo Return code != 1 ... Not the primary server
  58.       echo return code =  \v(pexitstat)
  59.       exit
  60.   }
  61.  
  62. If that doesn't help, then check to see what the subprocess actually
  63. returns as its exit code (OK, you say it is 1 but...).  If so, then make sure
  64. you are running the current version of C-Kermit, which is 8.0.211.  If you
  65. are, then we're in for some debugging; contact kermit-support@columbia.edu.
  66.  
  67. - Frank